﻿using NthDownload.Common.ViewModels;
using NthDownload.Contracts.Plugins.BandwidthProviders;
using NthDownload.Contracts;

namespace NthDownload.BandwidthProviderPlugins.ViewModels
{
    public class SpeedLimitBandwidthProviderDetailsViewModel : ViewModelScreenBase
    {
        #region Class Members

        #endregion Class Members

        #region Constructors

        public SpeedLimitBandwidthProviderDetailsViewModel(IBandwidthProvider bandwidthProvider)
        {
            //
            // Set Defaults
            //
            BandwidthProvider = bandwidthProvider;
        }

        #endregion Constructors

        #region Properties

        /// <summary>
        /// The bandwidth provider who's details are being shown
        /// </summary>
        public IBandwidthProvider BandwidthProvider { get; set; }

        #endregion Properties

        #region Methods

        /// <summary>
        /// Closes the dialog with a save result
        /// </summary>
        public void Save()
        {
            Result = ViewModelResults.Save;
            TryClose();
        }

        /// <summary>
        /// Closes the dialog with a save result
        /// </summary>
        public void Cancel()
        {
            Result = ViewModelResults.Cancel;
            TryClose();
        }

        #endregion Methods
    }
}
